#pragma once

#include "ihandle.h"
#include <tuple>
#include <map>

class IEvent;

class ServerHandle : public IHandle {
public:
    ServerHandle(IEvent* event);
    ~ServerHandle();
    std::tuple<bool, std::string> Init(const std::string& ip, int port, int backlog);

protected:
    int GetSock() const;
    void OnIn();
    void OnOut();

protected:
    IEvent* mEvent;
    int mSock;
};
